import Vue from 'vue'
import Vuex from 'vuex'
import transfer from './modules/store.modules.transfer.js'
import other from './modules/store.modules.other.js'
import lineList from './modules/store.modules.line-list.js'
import search from './modules/store.modules.search.js'
import lineDetails from './modules/store.modules.line-details.js'
Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
		CityName:"佛山",
        /**
         * 是否需要强制登录
         */
        forcedLogin: false,
        hasLogin: false,
        userName: ""
    },
    mutations: {
        login(state, userName) {
            state.userName = userName || '新用户';
            state.hasLogin = true;
        },
        logout(state) {
            state.userName = "";
            state.hasLogin = false;
        },
		SET_CITY(state,data){
			state.CityName=data;
		}
    },
	modules:{transfer,other,lineList,search,lineDetails}
})

export default store
